Just remember to wait for the completion at the end ( notice the spu_mfcstat outside the loop), or else your last bit of data may not finish transferring before it is used in the program! 只需要记住,必须等待最终完成(注意spumfcstat在循环之外),否则在程序中使用数据之前,最后的数据位可能还没有完成数据传输!
And we won't wait here one hundred seconds for it to finish, but we're using the loop, we're updating a variable, and we're formatting it in a nice way. 我们将不会再这里等待100秒来等它完成,但是我们使用循环,我们更新一个变量,我们把它排成一个漂亮的格式。
To wait all we do is put the thread into a busy loop ( a spin). 为了让线程等待,我们只需将线程执行一个忙循环(自旋)。
Since you do not have to wait for a list to be generated ( stop and go) or allocate a thread to processing the loop ( pipelining), this can be the most efficient method. 由于您无需等待一个列表生成完毕(停止并前进)或者分配一个线程用于处理循环(并行管道),这可能是最有效率的方法了。